package com.lineage.server.command.executor;

import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;

public class Eavesdropping implements L1CommandExecutor {
  public static L1CommandExecutor getInstance() {
    return new Eavesdropping();
  }
  
  public void execute(L1PcInstance pc, String cmdName, String arg) {
    if (pc.getcheckgm()) {
      pc.setcheckgm(false);
      pc.sendPackets((ServerBasePacket)new S_SystemMessage("GM监听:关闭"));
      return;
    } 
    if (!pc.getcheckgm()) {
      pc.setcheckgm(true);
      pc.sendPackets((ServerBasePacket)new S_SystemMessage("GM监听:开启"));
      return;
    } 
  }
}
